<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Meteocal</title>
<link href="./css/home.css" rel="stylesheet" type="text/css" />
</h:head>

<h:body style="background-color:#81a4c7">
	<div id="wrap">
    	<div id="header">
            <img src="./images/Logo.png" style="width:150px; height:150px;"/>
            <div id="welcome_txt" style="float:right; margin-top:90px;">
            	<h1>Welcome to Meteocal!</h1>
            </div>
        </div>
        <div id="central">
            <div id="info">
                <p style="padding-top:110px;">Meteocal is a new weather based online calendar for helping people scheduling their personal events avoiding bad weather conditions in case of outdoor 		                activities.</p>
                <h2>Not yet registered?</h2>
                <p:link outcome="/registration.xhtml" value="Register now" disabled="#{!loginBean.logged}"/>
            </div>
            <div id="login_area">
                <div id="login_container">
                    <div id="login_header">
                        <h1>Login form</h1>
                    </div>
                    <h:form id="loginform" style="font-family: Comic Sans MS; color: #ffffff; font-size: 20px" >
                        <h:panelGrid columns="1">
                            <h:messages style="margin-left: 20px;" errorStyle="font-weight: bold; color:red;" layout="table"/>
                            <h:outputLabel for="username" style="margin-left: 20px; ">Email</h:outputLabel>
                            <p:inputText id="username" value="#{loginBean.username}" style="width:360px; float:left; margin-right: 10px; margin-left: 20px;" />
                            <h:outputLabel for="password" style="margin-left: 20px;">Password</h:outputLabel>
                            <p:password  id="password" value="#{loginBean.password}" style="width:360px;  float:left; margin-right: 10px; margin-left: 20px;" label="Password"/>
                            <br/>
                            <p:commandButton value="Login" action="#{loginBean.login()}" style="width: 370px; border:0; box-shadow:0px 2px 5px #000000; 
                                             float: left; margin-left: 20px; background: #6cb364; color: white; font-family: Comic Sans MS;"
                                             ajax="true" update="@all" disabled="#{!loginBean.logged}"/>
                            <h:outputLabel for="alreadyLogged" style="margin-left: 20px;" rendered="#{!loginBean.logged}">User already logged in. Go to your <a href="./user/user_home3.xhtml">home</a>
                            </h:outputLabel>

                            <br />
                            
                            
                        </h:panelGrid>
                    </h:form>
                </div>
            </div>
        </div>
        <div id="footer">
            <p>Software engineering 2</p>
            Project 2014-2015<br />
            Rimoldi_Lattari<br />
            <p></p>
        </div>
    </div>
</h:body>
</html>
